#include <iostream>

using namespace std;

int gNum = 11;

void test()
{
    int lNum = 1;
    int lNum2 = 10;
    static int sNum = 2;

    int *pInt = new int(12);
    const char *pstr = "hello";

    cout << &pstr << endl;
    cout << "&lNum2: " << &lNum2 << endl;
    cout << "&lNum: " << &lNum << endl;

    cout << "pInt: " << pInt << endl;
    cout << "&sNum: " << &sNum << endl;
    cout << "&gNum: " << &gNum << endl;

    //for char*, operator << has a default overload
    //it will get content of char* pointer, not the address
    cout << "pstr: " << pstr << endl;
    printf("%p\n", pstr);
    void *ps = static_cast<void*>(const_cast<char *>(pstr));
    cout << "ps: " << ps << endl;
}


int main()
{
    test();
    return 0;
}

